package net.oschina.foodon.examples.spring.cloud.service.gateway.filter;

import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import org.springframework.stereotype.Component;

/**
 * Created by foodon on 2017/4/10.
 */
@Component
public class PostFilter extends ZuulFilter {
    @Override
    public int filterOrder() {
        return 100;
    }

    @Override
    public String filterType() {
        return "post";
    }

    @Override
    public boolean shouldFilter() {
        return true;
    }

    @Override
    public Object run() {
        System.out.println("running javaPostFilter");
        System.out.println(RequestContext.getCurrentContext().get("name").toString());
        return null;
    }
}
